Quite a bunch of php changes, in prep for prereq parsing.