minor bugfixes

rewrite code (no usage of the CMSms internals anymore)

added "caching" of directory ouptut in browser to reduce server requests.

changed param file_type in media_type