Port the tests from webpage-spec.js

Callback, clip-rect, confirm, object, prompt, scroll-position,
viewport-size and window.

https://github.com/ariya/phantomjs/issues/12439
Don't rely on JSON.parse() for page.evaluate().

https://github.com/ariya/phantomjs/issues/12615