DOC: Add tutorial and update examples to use history.