Moved low database logic from Query to Connection

Updated the Query object to use methods from Connection which already
have most required logic.

Added Connection::preparedExecute() which was required.