Fixes #25: Automatic disconnect after generate_mapping()
Fixes #26: incorrect SQL generated when using exists() in the query
Merge master into orm: bugfixes