Major cleanup on new history module.