Refactor to make additional OS support easier, and to use service

resource to manage Gerrit service rather than exec. Small style changes.