Fix scripting plugin for multi-dataset (incomplete).

Still a lot to convert to the new API.