init
rm conflict
copied over from xphp5 because xphp5 is stupid
added final wait and remove scripts
fixed merge conflicts