Add tests for --no-header joining.

... and fix many bugs.

This code really needs to get cleaned up. It's currently duplicating
the logic for creating a CSV index.
Add comment about join test macro.