Move service check code into the Service class.

Fixes #3546