Unit testing

Note: does not yet include integration tests

Includes significant refactors on the server side and less significant changes on the client side, along with Travis CI support for both client and server tests.