selectionManager refactoring and bugfixes

also update the selectionManager's dependencies