Added 'ensure' parameter to classes, added tests to validate they work as expected.