Add some tests

Hello,

I noticed #1 and had some time spare so thought I'd write some tests. These are by no means thoroughly extensive but cover a majority of the functionality.

Jack.