[chrome extension] Refactoring all the JS into amd modules. Work in progress.