Compiler code cleanup and internal documentation fixes