Layer keyframing broke?

I’ve got a script in which I keyframe layer changes with
obj.keyframe_insert(data_path=“layers”)

It did work earlier (can’t remember which version of blender I used then, perhaps 2.4) but now using 2.71 it doesn’t work, giving this error in console:
TypeError: bpy_struct.keyframe_insert() property “layers” not animatable

Why is this not working now? Have the API changed?

keyframing layers was removed many versions ago.
You can keyframe object visibility/renderability

Huge bummer! Keyframing wise it gets much more messy with visibility/renderability when dealing with many objects.