Fixing minor bugs with cd

User was allowed to get away with formatting like "......" and
"../....." and it would go back one directory. Also if you just passed
in "~" then it would say failure because I break the string "~[other
files]" into two parts the ~ and the other files and send them seperatly
to chdir. In this case I didn't have a check for if [other files] was a
string of length 0. Chdir doesn't like strings of length 0.