What would happen if we tried to run a motor in space when it is not attached to anything to provide support to it? I know that a when a motor runs it generates torque and that torque can be used to do useful work. On the other hand, the motor needs strong support that absorbs the reaction torque.  In our case let us assume that that support is provide by a workshop floor on which the motor is firmly attached ( The workshop floor is essentially the earth) The earth receives the reaction torque and being the massive object it is, it doesn't move.
Now let us imagine that we took our motor into a space where there is no gravitational field. What would happen if  we tried to run the motor. Assuming the motor is powered by a battery pack. The battery pack and its control electronics are neatly packed around the stator.
Would the motor rotate at all? Would the rotor and the stator rotate in opposite directions? 
Would there be a transfer of energy from the batteries to rotational mechanical energy
 A: Your intuition was correct - the shaft will rotate in one direction and the housing/stator will rotate in the other.
If you look up "moment of inertia" you will find that it is the rotational equivalent of mass. For almost any reasonable motor the moment of inertia of the shaft/rotor windings will be smaller than the moment of inertia of the housing/stator. Since the total angular momentum of the motor must be zero (it has nothing to react against), the rotational speed of the shaft will be greater than the rotational speed of the housing.
As an equation, let $\omega _s$ be the angular velocity of the shaft, $\omega _h$ be the angular velocity of the housing, and $I_s$ and $I_h$ the moments of inertia of the shaft and housing. Then$$I_s \omega _s = -I_h \omega _h$$ where the difference in signs reflects the opposite rotation directions of the two, and $$I_s \omega _s + I_h \omega _h = 0$$
Assuming $I_s < I_h$, then $\omega _s > \omega _h$
A: The astronauts working on the Hubble space telescope had to bring special low torque wrenches to counteract the effect of the torque of the motor spinning them around, due to conservation of angular momentum, although this meant far more use of muscular power to hold them in place. And also to avoid damaging the equipment they worked on, such as screws within the HST.
So the motor driven screwdriver will work, as on Earth, but it requires more care in design, better hand, foot or body positioning to brace yourself and far more physical effort to get the job done.
