ENH: Keep list of next modules when inserting a module into the module history