Pull request for more meaningful unit tests and E2E tests

Now that you're all back from vacay, grab this stuff before you start working on it again please, mainly to avoid messy merging in the future...