add function+filter test helpers and refactor to use them
Merge pull request #22 from square/sunil/test-helpers

add function+filter test helpers and refactor to use them