History buffer added. TODO: implement history navigation.