Decouple it from smartcd and consider it zsh-only. This also adds required library functions from smartcd's lib/core/arrays.
Source: https://github.com/cxreg/smartcd/blob/4fef3d3610873d9e8044cb5be1922fb056f4228d/lib/core/varstash