Fix warnings

fix a number of warnings and one real bug discovered by gcc-4.7.3

The code spits out so many warnings when building with gcc that finding real bugs is difficult.  With this patch, the code builds completely cleanly with gcc-4.7.3.  No functional changes have been made except where noted in Tiles.h.

Play tested without issues.