Luis Lopes was the star attraction as Aberdeen beat Hearts 2-0 to move up to fourth in the Scottish Premiership.