Portability fixes, including elimination of variable argument macros. Rudimentary configure script. Miscellaneous cleanups.