Executes trees for JS simulator