Change build system to autoconf/make + restructure a bit