Adjusted build script.
Add realloc wrap, clean expand array stack function.