Use subset matching for extension in file chooser’s filter string

This allows ‘.js’ to match ‘foo.js.erb’. Special care is taken so that ‘.m’ doesn’t match ‘.md’, etc.

Closes #722.