Moved association builder to library code leaving associations.js only for data.