Used boilerplate to create extension, moved all code out of inline scripts so javascript could run.