Functional travis-ci build.

Squashing all previous (broken) patches along with the working one.