Reorganize code to use PSR-0 / use proper exceptions

This pull request has two parts:

1. I've refactored a bit to take advantage of PSR-0 autoloading (http://www.php-fig.org/psr/psr-0/).
2. I've eliminated the integer return code "exceptions" in favour of raising true `Exception`s.