Add a migration to generate new logos from the old ones, refs #412

Will find all logos being used and try to attribute them to spaces and profiles,
generating the new logos using carrierwave.
Adapting the migrations to work when migrating from master, refs #987

Some tables and columns were added both on master and on branch-v2, but using
different migrations (different timestamps). Moved and adapted them to make
branch-v2 work when migrating from master.
The tables are essentially the same, only the way the migrations are organized
changed.

There are still migrations to be added in branch-v2 (for recaptcha and shibboleth),
but this should be done with the rest of their tasks.
Cleanup .gitignore a bit

To remove 'public/logos', specially, refs #412, see 8d3c01300ed