Further stash refactorings
API docs and sequence number assignment