Fixes to startup scripts and supervisor for running under Xen.
Refactor hypervisor detection code.