Add a central registry for open files.
Add config option to specify maximum cache size.
Add cleanup functionality to cache manager to limit the maximum cache size.
Add global write guard for database to work around SQLite's missing
support for concurrent writes.
Cleanup imports.