Phpspec setup and major refactoring