Changed HeaderEntry to be immutable and refactored to use array/bitset for table and references.