Add client tests + CLI tests

The tests are as isolated as possible. They only share some static
data files.