Replaced old API with new API.

In both OpenMM and Toy engines.