Fix preload of locales

Rewrite the preloading code to work.

Also fix requirejs paths.