Store ref to app when app passed to the constructor

Flask documentation (http://flask.pocoo.org/docs/0.10/extensiondev/) says
that class based Flask extensions must only store the application on the
object when the application was passed to the constructor.

Closes #11.