Refactors, Firefox fixes.
Refactors.
Merge pull request #80 from guardian/agent

Refactors, Firefox fixes.