Move require 'assert' at beginning of testing function.

I've no idea why it was working previously (and still works in Node.js
versions newer than 0.6), but it's definitely wrong.