Refactor callfunc and callsub out of if statements

Note: while my server changes made this appear reliably, it is *still* capable of failing on the current server version!