Further template substitution fixes

Further to my comments this morning on pr #186, here are some more fixes for template substitution. This includes:
- allow format tags to be used in $Time$ and $Bandwidth$ substitutions
- better compliance of format tag testing with 23009-1
- escape $$ in URL