Refactor the Query class into a utility class that creates Select and
Update statements. Also added support for returning generated keys.