Added support of query execution. Added tests.