Reworks architecture with requirejs and remove TS