Clean code syntax in test-pipes.js

- fix not-defined 'emit'
- do not declare 'counter' as global
- remove trailing whitespaces
Add test for request.pipefilter

- check if request.pipefilter is invoked
- check ig request.piepfilter is called with correct arguments
Merge pull request #869 from tgohn/pipefilter_test

Pipefilter test