Many IndexDatabase improvements
Fixes to MIME entity retrieval to avoid premature recycling
Fix to DbDirectory.createDatabase() to return the existing database if it's already there (switchable)
Addition of StateManager to DocumentScanner
Addition of control switches to DocumentScanner to reduce memory footprint.