Added functionality to get previous command when up key is pressed

Currently only returns the last entered command, should use array to
cycle through all entered commands when up key is continuously pressed.