WIP on code documentation and cleanup.