automatically replace foreign keys as part of a merge operation
tested on Django 1.7 and 1.8
very likely has some unsupported edge cases