Rearch of underlying script code.
Functionality should be the same
Fixed some bugs in to_text()
Updated to correctly install all scripts (except query)