Use gcc; add warnings/errors; fix code to compile

Adding the warnings errors broke the build and brought out lots of
mistakes; fix them. Also generally update configure.