Cleanup configure.ac

This is a cleanup of configure.ac.
I moved most of the checks to separate macros in the m4/ directory, indented everything consistenly, fixed up quoting issues etc. Hopefully this will make it a bit easier for new contributors to add checks etc.

Cleaning up the checks  themselves is something I plan to do as a followup.
For example, I noticed that most checks don't error out if they can't find a required library.

I tested that this doesn't break anything on a few different hosts, from an old Debian Lenny install up to Fedora rawhide.

I still have to move out the sqlite3 checks, and test the oracle checks but I don't have Oracle available.

Cheers,

Ruben