travis-ci: refacor and add .travis-functions.sh

Travis yaml syntax, where we can only use shell one-liners, is awful
and ugly. We add a real shell script and source it from .travis.yml.

This commit squashes a lot changings because we don't want to
pullote history with this meta CI stuff.

Highlights:
  - enable make distcheck
  - cleanup configure options (enable all progs, with python and docs)
  - shorter config.log dump
  - out-of-tree build supported
  - testing locally is possible now
  - easy to add temporary debugging stuff

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Revert "tests, script/race is known to fail"

This reverts commit 6cae66ea4524246cbb4db6b7bad1ef7b0a2676d2.