Expand and reorganize documentation.

Also increase the heading levels so the result looks better on GitHub.