Full type resolution from Gson.

There's a ton of code because we need to construct generic types.
Merge pull request #167 from square/jwilson/types

Full type resolution from Gson.