fix and improve tbg

- fix that nested templats not fully substitued
- add warning if varibles create cycle dependencies
tbg: rename some variables, change warning

- unsolved_* to unresolved_*
- change warning text for unresolved variables
Merge pull request #21 from psychocoderHPC/fixTBG

Fix tbg