Autoconf

Ok, I have now properly branched the autoconf stuff, so this is the new pull request. Tell me what you think.