Hqmf template bug

Added a test for, and fix for, a bug that caused the hqmf_template_helper to not work when definitions were requested for both HQMFr1 and HQMFr2 documents in the same context.