Add Trim method from the CMS.

Fixes #6