Enable warnings as errors and a bunch more warnings

This will help catch things like #1078 and #1079 before they get committed