Rename saveSelection as getSelection

Because it does not save the selection.
Implement evaluating vars selection.

Clean up addLayerToDOM