Port a few basic tests of global objects.

https://github.com/ariya/phantomjs/issues/12439
Port the tests for error handling.

https://github.com/ariya/phantomjs/issues/12439
Port the tests of JavaScript's date parsing.

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