Add imageboard autoconf and polish code a bit