Add more information to instance info endpoint

Most of what we want is similar to the "form_extras" tags that we use in
our templates so part of this commit refactors for edits to share code
directly with the API.

This also fixes an bug where a model without an instance but with unit
data would crash the template tags.