travis: Add automated OSX build

Split some of the repetitive travis.yml logic into helper scripts, and
add cases for Mac OSX.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>