Cleaned JSON writing

This removed a lot of duplicate code. Since every model this creates
inherits from something, the only thing that changes is the textures
that get passed in.