Added selectAllVisibleRows to selection feature

As requested in #1477

Also extended unit tests to cover this and some other functions.