Add a utility to filter arrays

 - Filter definition has been borrowed from underscore
 - Also add a function to wrap array into a object for testing