Generalize sub-box dumping and extend it to 'trak'.

Tries to add better indentation, but doesn't really work.