b_main convenience function

Examples should use b_main instead of setting up each
component manually.  This reduces the amount of code needed
in examples and will reduce code duplication.
Fix failure to answer files with 0xFF byte

Integer truncation is a sorry thing.