Fix loading of extension after changing page

It was very worng to use the tab id to keep track of pages where the
extension was already loaded. The id doesn't change if page changes
(i.e. by clicking a link).
Code cleanup in injected scripts

Rename some variables and hide some symbols to keep the namespace
more clean