check in for discussion

Plenty of changes mostly focussed on getting the size down.
Use defines I_USE_XXXX to activate parts of the code.