Making the (action, element) tuple a namedtuple

This change just makes the tuple with the (action, element) into an explicit namedtuple, so it's able to be identified in the future.