first pass at mysqli conversion
Merged in mysqli branch. Closes #10