Made main.php handle exceptions
Replaced all PEAR errors with PHP exceptions in Loris
Replaced missing bracket
Fixed PHPCS errors found by Travis
Fixed excessive line length
Merge pull request #813 from driusan/ReplacePEARErrorsWithExceptions

Replace pear errors with exceptions