Add an option to define custom functions. Closes GH-80.
Clean up formatting on tests
Clean up doc formatting