Add tests for name->id conversion and make conversion results deterministic in conflict situations