Documentation rework.

Added documentation generation.
Fixed many documentation comments.