One of the conditions for the character auto-rigging script was the ability to rig a character not modeled in a strict T-pose. I developed this align by vector idea to put the rotation axis along the bend the joints were already created in. Basically, as long as they are not created in a straight line, the cross product of two bones will yield the necessary vector.