Refactored code that generates headers
Renamed getHeaders in buildHeaders to match buildQuery syntax
Merge pull request #68 from bettiolo/refactoring_march_headers

De-duplicated the logic that creates request headers