Whedon to direct Avengers movie