Added debug functionality.

Added debug functionality (text print out) via debug subproject and debug.sh script.