Added test for Delegation NL template.
Added a test for association

In the process, realised there was a bug that meant qualified associations
weren't handled properly, so I fixed that too.