Fixed bug in persisting deletion of related many-to-many objects when the deletion results in empty collections
Added connection threshold
Added connection piggy-backing
Added local connection management to session so that now connections are opened one per thread if possible.
Extraneous connections are held back for as long as possible.
Optimized imports
Cleaned up