Core: modularize client and use exceptions.
Tests: Some extra changes to the test suite.
Composer: Fix composer.json file.
Merge branch 'master' into fix-use-exceptions

Conflicts:
	composer.json
Merge pull request #4 from peregrinogris/fix-use-exceptions

Core: modularize client and use exceptions.