RequireJS integration

Replaced javascript loading with requirejs, removed, replaced, cleaned
up a lot of stuff.
Cleaning up