WIP: removing RequireJS and general refactoring