Make adding something to selection history clear selection redo

Issue #2305
Don't merge non-overlapping selections in history

Issue #2305
Fix linter errors
Enable selection-restoration hack for IE11