Fixed a bug where the options were not being passed correctly

This is the same as pull request 169 that didn't get in for some reason.
I also added a test so that this will be accepted now before version 2.0.

See also: https://github.com/mitsuhiko/flask-sqlalchemy/pull/169