Refactor parser statistics into own method

A pull request for [Issue #9873](http://tracker.modx.com/issues/9873). The parser statistics are currently output direct to HTML. It would be nice to be able to get them from code, which this modification does.