58810758 Refactor search reference association

This change is for https://www.pivotaltracker.com/story/show/58810758

Before we introduce synonyms on commodities this is a refactoring so that we associate synonyms to goods codes using polymorphic association instead of separate foreign keys on the table.

This changes api a little so requires merges on two other apps:

* TBD
* TBD