Merge pull request #2 from apache/upgrade-freemarker

Upgrades Freemarker to version 2.3.31 and cleans up code