Add apt-get update, su -c, GT.M x86_64 shared lib support

For cloud installs apt-get update needs to be ran before we install git,
build-essentials, etc.

Move most file creation and program execution to run su foia -c so the
commands are ran with the instance user and not as root

Add GT.M shared libary support for x86_64 as by default gtminstall will
only install the shared library version and not have the programs in
$gtm_dist

Add platform environment variable for cmake build name generation

Change-Id: Ide4aaa433eace00bdcccfbfc7fe03493069f91eb