Mainly documentation and code-commenting, some minor code cleanup.