Convert function number constants into readonly scalars.

Replace a bunch of 'unless' conditionals with 'if not's.