Restructure "bootloader" module

(Does not compile yet because of the storage dependency.)