move locations from Context to Definition. handle Definition serialization/deserialization.