Implemented PerSqlTemplateWritingHandlerTemplate. refs #477
Fixing PerCustomResultTemplatesTest.stg and adapting AbstractTemplatesTest and CustomResultTestHelper for custom results. refs #476