Finally working with ridiculous type casting... kinda.
Get this compiling so I can share.
Finally. Got it. Basically. Working!

This doesn't do much, but it does work. Needs tidying.