cmDefinitions: Don't store parent lookups

When looking up scopes, it is faster to not store the lookup locally to
keep the maps smaller and avoid extra allocations and rebalancing.
cmDefinitions: Avoid a find-then-insert when setting variables

Searching the map is not necessary.
cmDefinitions: Use a hashmap for faster checks

The hash map is much faster at checking that the map won't have what
we're looking for so that we can just go to the parent scope instead.
Merge topic 'dev/variable-lookup' into next

e17a69bc cmDefinitions: Use a hashmap for faster checks
3b21705d cmDefinitions: Avoid a find-then-insert when setting variables
5abfde6c cmDefinitions: Don't store parent lookups