Fixes to the unit tests, and to the template code itself.
Adjustments to use syntax-rules instead of syntax-case (required by plt-r6rs).