Be pedantic

Enable the `-pedantic` and `-Wextra` switches but disable `-Wunused-arguments` for now (too many instances, most of which are perfectly valid because they have to conform to a function pointer interface).

Fix some warnings that cropped up while compiling with both gcc 4.9 and clang 3.4 on OSX 10.9.2.

Putting it up here for review.