chore(travis): Broke out the commit message validator into a class to make it testable.

Added tests for the git hook script and the travis script.