Port the tests of 'system' module.

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