added block support to 'query' method (and you can specify :on option)