Add autoconf build files. Add framework for choosing algorithm.
Delete unused variables, casts to silence compiler warnings