Fix for Postgres template tests.
Made context a named argument at the start of every transaction.
Merge pull request #202 from PritishC/fix-template-tests

Fix for Postgres template tests.