Added modules for DOM document and window globals to improve testability of browser stuff.