Switch test body reading over to use ContentHandler for flexible templating
Bugfixes and tests for templating
Add context/variable testing to functional tests