Wow, really didn't see this coming at all. Huge news. I never rated him as a tactician but yes, the criticism was at times harsh, and the way he dealt with the players, the media etc made him a good candidate for the job.
I don't really have much of an idea as to who would take over. Dhoni is young, a seemingly permanent member in the test and sides, has a bit of experience at international level now and is currently leading the Twenty20 team, so he'd have to be favourite, but I don't know how good an idea that is, really. Yuvraj springs to mind as well, although he can't make the test team at the moment which rules him out.