Add simple test framework

Also get rid of requirejs and use nodejs module.exports directly.