Make $APPSCALE_HOME accessible in install_functions.sh

Removed DIST which is already set in build.
Moved install_functions so it's called after $APPSCALE_HOME is defined.