I just massaged Tong's patches a little bit. I squashed his two into one, and rebased the result against the latest HEAD.
In addition I made a few changes, which I left as separate patches (but would probably squash some for committing them) I would be ok with committing these as they are - there's still some changes I'd like to make, but I think that can be done once hte patches are committed. Tong: please let me know what you think, and how much I broke in the process ;) If you ACK them, I'll commit the lot tomorrow. David