Phase behavior of flexible and semiflexible polymers in solvents of varying quality.