remove esh-buf-stack, assorted refactoring