Move time entry stopping logic into a service.

See #239