Ref: refactored the `rollback` and `commit` functions.
Enh: APIS-529, Queries queuing needs improvement. Or it is 4 times slower.

Major refactoring of queries queueing mechanism for improved
performance. Added params option to `query()` function.