Import the JavaWriter rewrite from Dagger 2.

This is a complete break from the 2.x API. If we're going to merge
this, we should branch that project.

I've done my best to keep commit history complete.