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