More documentation and cleanup

This PR brings in more documentation and removes code paths that were unreachable.