Variables created is simple enough - just store a name->id mapping for the user namespace, and compare it to the state afterwards. Objects modified is hard, though.