Moved query checkers into URL util and added tests.