Sri Lankan spin bowler Rangana Herath picked up five wickets as Bangladesh were dismissed for 240 on the opening day of the second Test in Colombo.