Inchoate version with partially working example client app, hopefully correctly committed this time.