multiple fixes for bugs reported by @frozeman:
multiple fixes for bugs reported by @frozeman:

- when thumbnails path sits inside the options['directory'] tree, it should be hidden: turns out the code doing that contains two bugs:

1) scandir was taking the wrong thumbnail path to compare against, and

2) apparently my PHP version has a bug (or I don't understand strrpos with a negative offset); anyway the fix to 'ignore' the optional trailing slash is to use an offset of -2 instead of -1. However, that will screw things up for single-character directory names once this bug (if it is indeed one?) is fixed in a future PHP release, so we circumvent the issue by rtrim()ming the optional trailing '/'.

- also output JSON mime header for regular view JSON output, just as with every other JSON output.

- when scandir produces items which are neither file nor directory, list them as directory.

- when a path _inside_ the thumbnail tree is picked from view, i.e. for scandir, then scandir will fail so that the view handler will have to fall back to the first directory _outside_ the thumbnail subtree (assuming the thumbnails reside inide options['directory'] tree somehwere)

cpojer/mootools-filemanager,cpojer/mootools-filemanager