Merged changes from bdevenport - then re-added mysql code