Tidy up tt.h

Backport some non-functional changes
found working on 'dense TT' patch.

No functional change.