Updated the template parser so statistics now come through

Updated the template parser, kindly provided by Tomáš this includes V3
of COMPER which supports what we want to do with great speed
improvements