Added a bunch of unit tests

Added a lot of tests. Coverage isn't anywhere near 100%, but more tests will be added as more code is added to the app.