Improves performance for large numbers of files

Moves pretty_header call to outside of trans_tbl_init so that
it is only called once at the end of merging headers.
Replaces random numbers with file number in merge