support histsize & erasedups (closes gh-29), pure php implementation of libedit::readline_list_history