Work on refactoring popphp2 core