PHP version++, refactored, code cleanup

Changes were basically splitting this into directories and files, adding interfaces, formatting, and adding scope declarations to member methods and properties, plus comments throughout. If something doesn't work (above and beyond anything that wasn't working before), it should be because: A) the new scope limitations were set incorrectly for the usage it expects, B) the files aren't all getting included in the right order (check paths), or C) some weird little typo somewhere. I'll revisit this to test and continue edits soon. Feedback welcome!