Handle HTTP headers internally

Closes #19.