Add full support for projects requiring DOM

- Fix #442: Add Phantom.js environment
- Add a setting whether a project requires the DOM