Added doFunctionStart code gen, calls the setAndSave, build param stores, if name==main then do global init