Update dependency versions

Also switched from ~ to ^ to follow new npm recommendations
Rewrite filter pattern tests to be safer