Tests to client, address and identity

I started moving identity tests and decided to do #70, #71 and #72 in a pull request.

Moved some doctests, deleted some code, added a lot of unittests.