First addition of code from separate repo to this one.

Migrate the code as is, before starting to fix the issues

As discussed a while back this needs bringing in and then enhancing. TBR @ikeough