Update code to gofmt standard, fix Content-Type when charset is specified