Investigations of Massive Filaments and Star Formation (INFANT). I. Core Identification and Core Mass Function