Use Objects, not Arrays, in Selection.documents_from_cache. Fixes #339