improved indexer:
walks directory tree only once

factored out more pidfile logic to pidfile.py