Add code field to partner model

This allows partners to be identified without using a name that might
change or be translated.

Unfortunately, this involves a few tricky migrations to move data around
in the correct order.

Fixes #434 but reverts work done for #354