Google summer of code midterm review

Submitted on behalf of @rkojcev.  @jrgnicho and @shaun-edwards, please review.
Commented out code should be removed if we don't need it.