Google summer of code midterm review

Submitted on behalf of @rkojcev.  @jrgnicho and @shaun-edwards, please review.
There are quite a few includes in this header.  Are all of them required or could some be moved to source files?  Unneeded includes pollute the namespace and can lead to naming collisions.