58810758 Refactor search reference association

Uses polymorphic associaton instead of having separate foreign key
fields for each record
Merge pull request #128 from alphagov/58810758-synonyms-refactoring

58810758 Refactor search reference association