Fixing shutdown issue.
Cleaning up render states.
Adding doc comments to enums.
Doing a bunch of cleanup and documentation.
More cleanup and documentation.