Move utils into functions.sh

Signed-off-by: Robert Breker <robert.breker@citrix.com>