Refactor and update phploc