Rename space->n to space_id(). Remove key_def->cmp_order, which was unused.

Remove key_def->max_fieldno as well.
Rename space_n() to space_id(), space_by_n to space_by_id().