Python Indexed Dictionary with MongoDB-style queries