Implemented a dictionary-based compression of the template names. Seems to work, and reduce size significantly. Needs further testing.