add unit and integration tests

there are currently no tests at all... This add some integration tests and starts off some unit test.