Cache immutable visible scopes in the runtime component

Instead of recalculating/rewalking over the visible scopes
of atoms just calculate the scope once and cache it (as it
currently does not change at runtime) and return the cached
tuple instead to avoid the needless recreation whenever a
scope is requested for a given atom.

Change-Id: I47d24054c63e8620d26e7ade4baa239295daed0a
Merge "Cache immutable visible scopes in the runtime component"