Implemented shiftIn() and shiftOut()

I believe this is an obscure, "tricky" way to get the bit index based on the bit order.  This would be better as the following:
(bit_order == LSBFIRST) ? loop_count : (7 - loop_count);
or even better as:
if (bit_index == LSBFIRST)
{
    bit_index = loop_count;
}
else
{
    bit_index = 7 - loop_count;
}