a few tweaks for speed

I made one change to allow for returns in the json input and some tweaks for speed in formatting. Gitk shows some other changes and I'm not sure why - at any rate, I flagged all my changes with an MDW label so they should be easy to identify.