Issue #298: Fix bootloader remove trailing slash in paths and move path functions to better place.
Issue #298: Use getenv/setenv wrappers everywhere in the bootloader.