[chrome extension] Refactoring all the JS in the chrome extension into amd modules. Still a couple minor bugs to mop up.