Extract a method to represent keys in mappings

We wanted to extend `pyyaml` so that we could make keys unquoted in our representation of config files. However, there's no easy way to do this without copying the whole `represent_mapping` method. This simple refactor makes it trivial to do in a subclass, without breaking any tests