adding phpdoc, removing trailing spaces, added interceptor management, and some minor fixes
adding configuration abstraction
adding configuration abstraction
error handling
refactored test file to be easier to read