contentscript.js passes JSLint 100%...

Moved some functions around in order to fix their order.