Stole a bunch of code from Volley and Picasso.

This is still a work in progress.