moved some chromium-specific code into chromium.js

... (and fixed 'new function(){}();' in crypto.js)

This will make it easier to reuse the code when porting to Firefox. ;)