Test cleanup

@kevgo

Push some code into helpers and introduce a few more run helpers
`output_of("git branch -vv | grep -o '\[.*\]' | tr -d '[]' | awk '{ print $2 }' | grep . | wc -l").as_integer` ?

This is pretty close to 

`output_of("git branch -vv | grep -o '\[.*\]' | tr -d '[]' | awk '{ print $2 }' | grep . | wc -l").to_i`, so we could go with that as well imho.