Added client/server functionality, tests, and fixed bugs