fixed RegexpQuery, added ToJSON instance