Big refactoring..Added phpdoc support