added query module and tests.
added util module for random, hash, binary encode functions.