Remove subshells & simplify code to work with bash & zsh

Hi, saw your post on archlinux, thought I'd help a bit :)