Added handlers call to executeQuery and executeCallback.
Added handler for exceptions. Move some duplicated logic to new methods.
Added new tests.