Added support for repository server hook and improved tests

I think that this description is wrong.