Remove some deprecated code.
Replace uses of dirname(__FILE__) with __DIR__
Remove unnecessary uses of DIRECTORY_SEPARATOR.