Backend work for notebook templates.

Now we have a template class/model which corresponds to each part of
the notebook hierarchy. When a new user is given access to the
notebook, a parallel hierarchy of instantiated models (PageTemplate =>
Page, etc.) is created and saved. This is then destroyed if the user
is removed from the notebook. This is only on the backed, though -- we
don't have these changes integrated in the Backbone code yet.