Attempt at fixing Travis for OSX.

Move install into external shell script. We cannot use apt-get on OSX, use brew instead... Also valgrind isn't used at the moment so skip intalling it.