How Trade Patterns and Technology Flows Affect Productivity Growth