Convert remaining examples to new API
Add some tests