First attempt at converting to a PHP 5 package

Convert to PHP 5 OO style.
Errors are now reported via PEAR_Exceptions.
Removed deprecated commands/parameters.
Gets rid of strict errors when running with PHP 5.4+