Kumar Sangakkara scored his 31st Test century as Sri Lanka's batsmen dominated the opening day of the series against Bangladesh in Galle.