Added some unit tests.

The 'check that it's working properly' one, isn't working. Comparing
bitmaps is hard...