[closebrackets addon] Add some braces
Add file extensions and helper functions to meta.js

Added file extensions to the meta info. Added helper functions
getExtFromMimeType,  getMimeTypeFromExt, getFilenameAndExt from a file
name, and detectCodeMirrorMode from a mime type
[mode/meta.js] Integrate changes, clean up style

Also update the mode loading demo to make use of the info in that
file, allowing filenames and mimes to be entered.

Issue #2828