Add full support for projects requiring DOM

- Fix #442: Add Phantom.js environment
- Add a setting whether a project requires the DOM
Merge pull request #585 from gzm0/phantom-js

Add full support for projects requiring DOM