Simplify and comment services.cfg.erb file

Use ternary operators to simply the logic in the template and add
comments so that it's a bit easier to figure out what's going on here.