Fix a bunch of warnings found on OS X

I fixed a bunch of warnings that I ran into when building on OS X (Xcode 4.6.2). I tried to break them up into one commit for each kind of warning. Mostly just removing unused things and replacing deprecated calls. The biggest change is in 0d87f17 where a wrote a new helper function to replace the deprecated functions on anything older than 10.6 (I wasn't sure what the minimum requirements for Polycode are so I was conservative).