Add possibility to filter messages with a function

NGWebSocket.prototype._onMessageHandler() now take a `filter` property on
the callback instead of `pattern`. This can additionally to being a
string to match on exactly or a RegExp pattern be a function which will
run the callback if the function evaluates to `true`.