Ideal factoriality, semistar operations, and quasiprincipal Ideals