Selection: Only emit dgrid-deselect event if previously selected

Also adds tests for select and deselect events, courtesy of @treasonx.