Fix for multiple line blocks and trailing line feeds.
Fix the template pattern in IntegrationTestCase
Add some more basic tests.