add some numerical handling to Pow imaginary/real handlers

When the argument of the base of a power is a rational number, detecting real or imaginary values is possible. This processing was added to Pow._eval_is_imaginary and Pow._eval_is_real. In addition, a quicker exit was implemented.
Yes, I'm thinking about it. Let me know if you come up with anything. assumptions uses a function "test_closed_group". I don't enough about groups to know the vocabulary to describe behaviors like TT->T, TF->F, TFN->N, TFF->N, TNN->F (where T is True, etc...).