Ensures an object is instance of a class, or constructs one if not