DO NOT MERGE. Cherry pick 'Simplify test filtering + unit tests.' Dependent on external/junit fix Iea8dcebedd2c4061d52317457b739813d499ff69 for JUnit3 test filtering. With that change, can simplify test filtering logic. Also add more unit tests for filtering logic. Change-Id: Ie6f592d873ac1d0c8a93b115c3c68b3b38bbbfbc (cherry picked from commit b3257bdff63a867b4bf4fb739e1e212fe2128e78)