Added switch for debug output

Hi,
this is my first time creating a pull request and I'm kinda new to git as well so bear with me. I added an option -d to your test.sh script that allows switching a debug flag on/off. I also added a corresponding debugger to the main template that can be compiled away (found on quora, suggested by N. Garg here: http://www.quora.com/What-are-some-macros-that-are-used-in-programming-contests). Hope you find this as useful as I do.

Best regards,
Matthias Kauer