Rank keys so far could be of any type as long as it was
yaml-serializable, however this would introduce problems down the
line if a Location contained for example array or mapping.
This commit restricts the type of keys to only scalars and enums,
to limit the chance that a key serializes in an invalid location.