Externalize js

Move js to external files #15 to fix issue where extension cannot be run unpacked #13.