Replace a ton of bitshifting with bitfields.