Add requirements file.
Add basic test for the client and server APIs.
Refactor for testability. 100% branch coverage.