Framework refactored for PHP Unit testing