fix for #6: the example script was trying to access subdevices in the revert function, but subdevices was not always being created.
For the sake of consistency, shortcuts to the list of a device's subdevices and creatable resources (e.g. alarms, triggers) are now functions, providing a copy of the list of devices/resources, to make it harder to accidentally modify the object's internal data structures.