Enable customization of generated boot scripts

Functions specified with the new parameter {boot_phase_fun, fun/4} can be used to control the contents of boot files.

This pull request is based on an earlier (not yet approved) pull request in order to simplify merging.