Fix header casing

- Looking up or overwrting headers based on names isn't working with mixed case. Made some changes to always use lowercased header names.
- Removed the lowercasing of header values because it breaks case-sensitive values (like base64-encoded basic auth).

I also fixed the tests as they were failing because i started my changes.