Completely re-wrote the bit reader to use a byte array (so much nicer).