OK, so it was not the ideal circumstance, but a bug I discovered last night whilst posting make me look at my content management system again (Rectang XSM) this is now nearly all ported from the php origins and starting to look good.
However the nasty function for generating the main page view/edit screens is still looking like php, so I finally got round to redesigning the system. I now have a really nice OO way of defining document types which makes so much more sense, once this is implemented it may be a good time to open up the sources 🙂