Cleaned up the code for compatibility with manifest v2.  Needed to move javascript out of the html pages as this is now a security violation.