Add support for action metadata

Metadata can optionally be attached to actions. In order to do so, the current
action id is now returned when an action is started.