Further changes and slow progress towards a working PR.

Still so many bugs and issues and style problems to work through,
the worst is things like the type validate doesn't work.