Tidy some tests and move hooks to HookRegistry
Merge pull request #544 from SemanticMediaWiki/tidy

Tidy some tests and move hooks to HookRegistry