Converted old mysql_ functions to mysqli usage
Added back selectDatabase() function
Moved to mysqli object calls for errors
Organizational rearranging