Refactoring + regex handling

Changed the test file so that all the queries are evaluated in a single run.
A few efficiency checks for regex queries.