General improvements

I've taken the liberty of forking this repo, and tweak it a bit. I've changed the coding style to be more compliant to the PHP-FIG coding standards. 

Return values are, in my opinion, more consistent (methods that return an object, return null instead of false on error).

Exceptions are now thrown when the arguments are malformed/invalid, and debugging is no longer done by simple print-statements. Instead an array is used, which can return or (for now) echo the info.

Constants and classes are qualified in such a way that using this class can't cause issues in a namespaced project.

More complete doc-blocks (in terms of types)

access modifiers have been changed from private to protected to make it easier to extend from this class.