add function+filter test helpers and refactor to use them

@bryanduxbury 
CC: @square/cascading-contributors