Minor optimizations to selector code.

I don't remember why I ever thought all that sorting was necessary.
On second thought I don't think this assertion buys us anything.
Avoid relying on KeyError in Scope, which might be a whole tree of Scopes!
Remove a tiny bit of unused state from prepare_source.
Stricter normalize_var.