grub2ext: refactor code, user lib/utils