Djokovic beats Federer to win World Tour Finals title