Convert header_lines into a map

Couple of things - 
* Not sure if this approach is better than overloading the comparator with a case insensitive version. 
* Maybe we  should refactor all the *_header_line() into a separate class
Here you prefer the first `val` if there are duplicate `key`/`val` pairs, but at https://github.com/rethinkdb/rethinkdb/pull/2812/files#diff-659a1e4cf937d9e4310c477807729227R596 you prefer the last `val`.  Is there a reason for the discrepancy there?