Fix `build-matrix.rb` script. Fixes #157.

Also use `.travis.yml` to decide what combinations to run. This means we
can now simulate the Travis CI build locally and avoid duplication.