Corrected metadata loading to just add the 'filename' key to the loaded metadata object instead of incompletely rebuilding it.

Also, fixed some jshint warnings.