Finished refactoring the client, with an improved method for passing functions for converting between Provider and Template