Consolidated header logic. StingIO. More tests.