Added header compacting method to increase max size of files from 115MB due to writes being in 4096 chunks.