Molecular and electronic-structure basis of the ambipolar behavior of naphthalimide-terthiophene derivatives: implementation in organic field-effect transistors.