add some comments
fix encoding issue when manifest's name is non-ASCII
add test

Due to the modification of bootloader, you should compile and install the
bootloader first before running this test or it won't pass.