A brilliant 166 from Dawid Malan was backed up by Tom Helm with the ball, who took 4/8 in a rapid spell before the end of the opening day to put Middlesex on top.