Make template remover more robust

marktraceur pointed out that my previous code will fail at
{{echo|{}} which is, unsurprisingly, valid wikitext