added some unit tests

including some minor changes to easy mocking