Fix compatibility issue with extensions for recent flask versions

Flask from 0.8 changed the way extensions are loaded.

Read http://flask.pocoo.org/docs/extensions for more information.