Add Python 3 support.

This commit combines the output of the following:
    lib2to3.fixes.fix_except
    lib2to3.fixes.fix_idioms
    lib2to3.fixes.fix_import
    lib2to3.fixes.fix_ws_comma
    lib2to3.fixes.fix_xrange
    libmodernize.fixes.fix_dict
    Replace filter with list comprehension.
    Wrap map() in list/tuple, it's an iterator in Py3.
    libmodernize.fixes.fix_metaclass
    libmodernize.fixes.fix_next
    libmodernize.fixes.fix_raise
    Update imports using six.moves.
    raw_input
    Fix urllib
    Fix print handling (brackets, __future__).
    Fix unicode handling (remove u'', smart_str/text).
    Python 3 string related fixes.
    Update model string methods for Python 3.
Include typeof check in JSONP callback response.

This is more robust, and helps against attacks such as Rosetta Flash:
https://miki.it/blog/2014/7/8/abusing-jsonp-with-rosetta-flash/
Remove requirement for Python GDAL and memcached.

Add Python 3 testing to Travis, and work around issue with echo/YAML
indenting.
Use backport of Django 1.7's update_or_create.

Django 1.7.1 calls the built-in version by default on related managers,
so move to using a verison that matches its behaviour more precisely.
Fix flake8 warnings.