Add Undum's priority based selection filtering. No tests yet.
Add tests for undum's priority filtering.