Dimuth Karunaratne and Kusal Mendis both scored centuries as Sri Lanka dominated the opening day against Ireland in the first-ever Test between the nations.