Major refactor - refactored mysql and sqlite drivers