Updated to use PDO. Also implemented new fields, made all the setters in fields chainable, and some other minor fixes.