Extracted Debug and logger system to a middle ware
Added more test
Signed-off-by: Pascal Piche <pascal@nitriques.com>