Spin and chirality orderings of frustrated magnets: Stacked triangular antiferromagnets and spin glasses