Refactored to build and requirejs.