add some comments, make max_history public and settable from the $config
array