Add more generic function mad_command

The new function should be used in favor of the now deprecated
_mad_command function.
Use the new simplified .command internally

This should be mostly backward compatible. One excepton is .match which
used _mad_command before.