Preparation of polymer nanoparticles, and the effect of nanoconfinement on glass transition, structural relaxation and crystallization