Switch to mockito, reform unit tests a bit