Refactor and improve things.

This may still be provisional, but I'm writing an application and its
tests using pyjamas and changing things to how they should be expected
to work.