added a few utility functions and fixed a bug with caching of queries using regex always returning the same results due to the handling of objects by JSON.stringify