Rewrote the argument handling code for the hander functions. It is
*much* more understandable now.