Refactored Selection.
Merge branch 'master' of github.com:substance/document
Fix regressions after Selection refactor.