Rearange client tests and general cleanup