DB migrations: assign projects to Documents/Notes

This migration contains migrations for document and note objects,
explicitly assigning them to specific projects in the same way that
ae2763a did so for topics.

Migration 0097 contains a PL/pgSQL script that will not work on Postgres
versions before 9.0, since it uses the DO command, introduced in 9.0,
for executing an anonymous function.

We may want to treat documents like clusters that can refer to the same
thing in the same way we treat "TopicNode" objects and project-specific
pointers (i.e. names, summaries, assignments) to them. If we want to do
that, we can go back and edit 0097 before we apply these migrations to
the production site.