Another pass at context clean up.
Merge pull request #249 from youtube/replication

Another pass at context clean up.