image: Move common config into extra config file and change *_DIR variables to absolute paths

Also rename the optimizations directory to patches.

Only use sudo for the apt-get line in prepare-host.sh.
image: Remove a sync command