Implement up and down to traverse command history