Improved YAML parsing

This seems to work. 8e795b5 will be removed and a246d26 will be modified to use the forthcoming YAML modifications. c3c8791 will also need a closer look. I'm not convinced that regex is exhaustive.
The original name is not recorded elsewhere. Its on my list. But it will be easier to implement if I do the transforms by hand.