Improve script parsers and adapt to experimental libnpa
Sync with experimental libnpa