Unittests clean

Okay, I think I got a clean history now.

I can squash the commits if you guys are still interested in this. If not, that's fine, it was mostly an exercise for me anyway.
There were a few tests I couldn't get to work and I can't really be bothered to fix them.