Added an option for dom environment

You can now switch on/off the dom environment. Useful when you need only
JavaScript execution and do not need access to the dom.