Refactored the HtmlChunkedPublisher class to reduce its size

This bug was detected by SensioLabs Insight (rule # 36-040):

"PHP class is too long (it should contain less than 500 lines)"