How it works
A shell function named smartcd is defined which can be used as a replacement for the cd builtin.
Configure it in your .bashrc, .bash_profile, .zshrc, whatever:
source ~/.bash_arrays
source ~/.bash_varstash
source ~/.bash_smartcd"
alias cd=smartcd