Add Factory#from_map_or_db to enable identity map support for criteria based queries