Improve build scripts and Travis integration.

A lot of tiny commits because that's just how working with CI works sometimes.