Fixed bug where projection and header records could be written multiple times

Added check to make sure that file header and projection records are
written to a file once and only once.
Added mbampstats program
fixed untracked files