Update the example scripts to the new API.

This should have been done a fair while back.