[WO-305] Implemented unit and integration tests

I added unit and integration tests. Includes some previous changes as well