Cleaned up RequireJS implemenation. Reorganized application dependencies