test-x64.py: hoist image build
python: Better handle of dir_root and implementation of phase in test-x64.py