Optimized header map implementation and tests (Part 1 of 2)