Tests

Tests for most accessible functions in the application. Fixes a lot of important bugs and covers edge cases.