Adding unit tests and completing other integration tests