External sessionmaker passed to plugin

Now passes the external sessionmaker to the plugin, to agree with last update.

"One sessionmaker instance per application."
replaced type() with isinstance()

isinstance() is far more flexible and is recommended by the docs.
Merge pull request #15 from delax/patch-2

External sessionmaker passed to plugin