Add some SQLAlchemy best practises

Had problem with non-commiting data, add "autoflush"
Fix bug in import

I'm not 100% sure what happens, but I think I missed flushing the
session properly. Now I commit every 10000 entries.
Merge pull request #109 from robinandeer/sqlalchemy-improvements

Add some SQLAlchemy best practises