Refactored models. Added a debug option to model config and a port option for PDO.