painstakingly restructured modules for requirejs. Happy with result though