headers: added has_invalid_header

renamed some camelCase methods
refactored a couple blocks into functions
moved config checking/loading into functions where used