Tests

* Refactored and reauthored unit and e2e tests