Fix some modules and Collection Triggers

A) The after and before events of CollectionTriggers were called twice each time a Collection was removed. I have added a test for this and fixed the issue.

B) When enabling all extension modules in eXist, there were failures, I have now fixed:

1) metadata module - compilation and test failures. Still one failing test `removeXMLResource` which I have set to @Ignore

2) svn module - all the tests in the `XQueryFunctionTests` class were failing. Fixed a config problem there and then set 3 still failing tests `test_002`, `test_010` and `test_011`.