Implement depth sorting for models.

Currently sorts all models, not just models with transparent or
translucent elements.