Got version filtering working
Added more tests
Refactored some code