new API: methods on Client and Server objects, instead of raw functions

This new API should be easier to use correctly. The README is also new.