Move the example client code from largemouth and fix some small bugs