Fix attaching timing JS when content-type includes charset

Fix `ResponseListener` bug where the timing header & footer is not attached if content type includes charset e.g.  `Content-Type: text/html; charset=UTF-8`

Fix coding style issues