Bring back filtering functionality

Apparently some of the tests are dependent on the filtering feature
inside of 'getUndoneMigrations', so it needs to be reintroduced to get
the tests to pass again. Unsure if we should remove this feature or
keep it around, but the tests are passing again.