Fix lots of file references and missing files. Also worked up PHPDoc stuff.