HeaderIdentifier handles more heading text edge-cases

• Iterates purely numeric headings nicely
  '123' -> 'heading-123', 'heading-123-2'
       not 'heading-123', 'heading-124'

• Handles headings with no useable ascii characters
  '.%#中国！' -> 'heading-1', 'heading-2', etc.
            not 'heading-', 'heading--2'

Also factors out building and iterating the header ID into separate
class.