Improve compiler logic in configure.

The highlights of this pull request are:

- `--with-cc` and the related compiler-selection stuff has been killed in favour of setting the CXX environment variable (this follows the UNIX way&trade;).
- `./configure` will now automatically try to detect the compiler (checking for `c++`, `g++`, `clang++` and `icpc`) instead of just assuming GCC (or Clang on OS X).
- Compiler version detection now works properly on Clang and ICC as well as GCC.

~~In order to avoid merge conflicts I have held back some changes until #577 is merged.~~

~~This will probably break Jenkins due to the killing of `--with-cc`.~~