add license in a file, close #3
fix typo
cleaner code, more comments
fix jshinting; shorter method name
cleaner format setup, rename sort functions to compare