Small changes to ensure that we can output the original source.

This is almost complete now - only quotes appear to be incorrect.