Discard comments as early as possible to reduce the number of allocations
and subsequent processing. Removed some unused functions and enum values.