Header reorg
Eliminate more old helper macros
in favour of R API
Use standard R headers.
S compatbility no longer needed