Replaced all PEAR errors with PHP exceptions in Loris