Productivity and the Decision to Import and Export: Theory and Evidence