St Johnstone made a winning start to the Scottish Premiership season as they saw off a young Hearts side 1-0 at McDiarmid Park.