allow nested brackets when expanding macros
allow \{ and \} but not empty lines in macros
expand \def, \renewcommand and \DeclareMathOperator