Factor out a Client class, separate Entity classes

This also changes the client API slightly (post vs posts, etc).