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.