Fixes for gcc < 4.7, warning squashes

* Adds check for GCC < 4.7, removes incompatible flags
* Fixes printf formatting strings to avoid warnings
* Changes memory allocation routines for image buffers to `malloc`/`free` to avoid warnings due to `delete`'ing typeless pointers
* Squash boatloads of warnings on windows by defining `_CRT_SECURE_NO_WARNINGS`