Convert contentscript to ES6 module

Now uses the environmnet module as well.