Reorganized code to be mostly in header files, may help with compiler inlining instrumentation code or compiler deriving properties of instrumentation code.