Make the library work with `python -m`.
Remove unused imports, incidentally fixing compat with whoosh 2.5.