working commit.
Working commit.
Core refactored to use PDO