Doc fixes

Here I have copied the way that IPython generates it's API. We may want an even more customised solution, but I quite like the way that this looks in terms of the API. Anywho, it now generates what appears to be at least reasonably sensible output.