packages renaming, fix templates and complete the freemarker test cases.