Initial implementaiton of the gptprio 'next' command for grub.

This is the real deal, the thing we need to replace `cgpt next` and kexec with a bootloader that knows which system to boot in the first place. :-D
Does it make more sense to specify the max in terms of the field width? This function only works if max is 2^n-1.