Added unit tests, and fixed bugs found during testing, added composer.json for dependency management.

Added unit tests, and fixed bugs found during testing, added composer.json for dependency management.

Signed-off-by: JC Francisco <jc.francisco@orangeandbronze.com>