Header and footer code now in the structs. Also small update and fix to NIF_IO HeaderString read/write.