Extract utility functions from base hook

There were a couple of functions in the base hook class that could
easily be extracted to the `Utils` module.

Also made a few other minor adjustments to get the line count down to
appease RuboCop.

Change-Id: I630123e82452a44e6e6d84aa5f6ea58f3d45eff1
Reviewed-on: http://gerrit.causes.com/44897
Tested-by: jenkins <jenkins@brigade.com>
Reviewed-by: Shane da Silva <shane.dasilva@brigade.com>