Move utility functions to Common; add 'type format = Vhd | Raw'

Signed-off-by: David Scott <dave.scott@eu.citrix.com>