abstracted two sorting methods into one
Merge pull request #20 from luisparravicini/jscompile_refactor

Sorting filenames refactored