added [object DOMWindow] check to support phantomjs
added tests for custom viewport and added a local jquery version (1.7.0) to make tests work with phantomjs