Added comments to setopts, improve history and menu completion