Tiere/client refactoring

Client has been refactored and unit tests have been added. Also some parameter validation.