In setSelections, default primary to old primary if not given

This makes it easier to update selections by mapping over them.
[sublime keymap] Fix behavior of swapLineUp from last line

Issue #2362

Also add origins to the changes generated.