Actual mysql connection test, clean up some code