New function _rebuild_master_index() (partial implementation).