generate documentation for public functions from docstrings
a few small mistakes
We don't need the "is main" hack anymore
spelling fixes