Major refactoring.  Still bit more to go on server side and wrapping up rpc connection