Bringing last stragglers into using db_ function instead of manually constructing PDOs
Send content-type and charset header in head function
Only connect to DB if neccecary