undone : change argument validation to use `assert` to optimize code size and runtime performance in production mode

In particular the check in `Schedule.call` to check if the action is in
the history list can be expensive as it is O(n) on the size of the
history list and history lists can get big.