Former world No 1 Mark Allen beat Kyren Wilson in a topsy-turvy thriller at the Crucible to seal a place in the quarter-finals of the World Snooker Championship