Add functionality to collect all parameters that are reference values

This will make it easy for users to pull out all reference names they
would need to compile the template.

Also, fix a bug where collectTemplates() doesn't explore the 'else' of a
block.
Fix checkstyle
Make build less flaky by using set comparison
Merge pull request #317 from oefirouz/master

Add functionality to collect all parameters that are reference values