Merge foldstack.go and stack.go