Chemical modification of drugs to promote their self-assembly into nanoparticles for improved delivery