Add ServiceRegistry tests

This tests have been (mostly) ported from the old BR code base. I've
cleaned them up a bit, removed the ones that are no longer valid and added
a couple of new ones.

This fixes #763
Merge pull request #786 from janhancic/develop-add-serviceregistry-tests

Adding ServiceRegistry tests