[Leveson] Move name prettifying to parser.

This makes it a bit simpler, and also fixes an issue whereby a section
heading was being incorrectly shrunk by being treated as a name.