Cleanup examples.
Merge pull request #628 from realm/cm-examples-with-close

Example cleanup