Recursive goToHistoryState

The isRecursive option of goToHistoryState now does something and handles
concurrent states.

This probably needs some unit tests, but I'm just looking for a sanity review at the moment.