ANSIfy. Remove unnecessary casts. Clean up for -Wsign-compare. Make morethings file-static. Other minor tidyups, and fix a couple minor bugs foundalong the way.