Refactor 11 14

This refactor brings regex queries, collection by name and tests that actually test things.
We might need to add an additional check. Check out the second answer in this link:
http://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object