Add code for determining system environment

zsh/zshrc: add code for determining system environment
zsh/zshrc: some code formatting