Bugfix/filter parser fails to parse blackets

I forgot I sent a pull-request #72 to the upstream repository. the upstream has been evolving since I sent the pull request. 
So I've merged the head of the branch master and rewrite a test code. 

@jch Thank you for informing me. 
I got it :sushi: I'll try to write an integration test. 
now I'm using this patch against ActiveDirectory. it works well in my environment :)