Mysqli and Restructuring

MAJOR security improvements