Low hanging fruit

These commits bring the number of compiler warnings down from 260+ to 30 or so. I'm avoiding some deprecated APIs and making better use of const where applicable. Hope this helps.