Improve argument validation in frame:expandTemplate()
Just like the other methods, e shouldn't be allowing passing of things
that aren't numbers or strings here.
For that matter, we should just abstract out the whole "arg key and
value validation" into a separate function instead of repeating it in