Change main loop to only check relavant numbers. Also change set_number
to take a mask rather than a number for cases were only a mask is known.
Change xrefs to be pointers rather than array references. No difference
in time.