Escapes regex chars in pagepart handling

Dollar signs in the handling of pageparts (appendPagePartTemplates) caused
the method to crash. Now the characters are escaped.