First version which actually runs!

Although it doesn't do anything useful, at least it doesn't crash.
Fix bug in JS to make the whole test actually do the right thing.