Refactored project to support requirejs