Add filtering support on the dispatch side of pub-sub

This pull request adds command filtering support.