Build with -Wall -Werror

Is there a reason we don't build with `-Wall -Werror`? (Or at least `-Wall`?)

This PR does three things (in order):
* Fixes bugs, dead code, and style errors exposed by `-Wall`.
* Makes small changes that allow building with `-Wswitch -Wcomment -Wuninitialized -Werror`.
* Turns on `-Wall -Werror -Wno-sign-compare` (the latter due to the Google style guide's recommendation to avoid unsigned ints).

The first of these things should be merged; the last two I'm in favor of but would like to open for discussion.

(By the way, from my quick reading of the code, it looks like bad things will happen if different numbers of channels are specified in a window file for `WindowDataLayer`.)