added grunt build file, refactoring and tests for autocomplete and categories