Use 'assert.js' instead of home-made assertions

These assertions are ported from Node.js and enjoy the benefit of tests.