Refactor client to use classes. Add first client test.