Simplifying layer mapping

By making selectionLayer an object keyed by source layer UIDs,
we save some indexOf lookups.