pulled out window/document augumentation from jsdom to make d3 working on the server side, without contextify