Converted mysql methods to mysqli

Also set Graph to use composition with MySQL class