Add debug interface
Fix minor bugs
New templating engine for q_class 1