unified travis script to handle different branches

Line too long. Actually I don't think we need to reference that discussion. If there is anything important there, inline it here in a comment or a commit message.