some js refactoring, grunt requirejs addition, initial build