libbootimg - a cleaner implementation of the boot image logic