Rewrites all file extensionfiltering mechanism. Rewrites tests for them. And some other minor fixes