Gary Anderson beat Michael van Gerwen to move through to the quarter-finals of the World Darts Championships.