Core/Phases: Added missing sql and changed how phase_definitions will work, implementation still missing