Fix some warnings found with Coverity

* Do a bounds check when running mapmod events
* Prevent some divide-by-zero cases
* Add some missing variables to init lists
Replace SDL_Color with a new Color class
Add bounds check when doing mapmod on collision layer
Add error messages to previous fixes
Merge pull request #958 from dorkster/static_analysis

Fix some warnings found with Coverity