Move macro sanity check into separate function

This moves out from macro_translator the macro/param length sanity check
into a function called check_macro_sanity.