Adding most of the stuff, including client.
Still need to test it all :D