Use custom SQL instead of models to fix maps download bug

Fixes https://bugs.launchpad.net/oq-platform/+bug/1395784

With this PR we use custom SQL to be sure that the ```the_geom``` column is in the 2nd position. I also cleaned ```models.py``` to be more pep8 complaints.