Initial unit tests

But you are right it's not obvious. I'll rearrange it a little bit.