Refactor action handling

Since BeginContact and EndContact both perform actions we do not
need to distinguish between them, so move the functionality to
a common helper function.

Also allow multiple actions per event..