Configuration system refactor

More flexible than the prior version and in particular allows cross-compilation.

The native build was tested on win64 with Windows SDK 7.1 and Strawberry Perl 5.16x and the cross build from Cygwin32 to MinGW64.

The environment anc compiler settings (first ~160 lines of `Configure.pl`) need some tweaking - in particular, the linux flags probably miss a `-luuid`.

Feedback from all available platforms (in particular linux, darwin, bsd) would be appreciated.

As a side note, this also makes APR compilation on MinGW64 mostly work - they do some creative stuff with winapi header inclusion order, which makes it necessary to twiddle with `<wtypes.h>` after the build aborts.