Added Test::Class based test suite and fixes a bug in the main module added some todos for future improvements
Cleaned the debugging a bit