Add convenience macros for working with bits.

This commit removes GET_BIT() and its comment, and adds several modular
bit manipulation macros, each with their own comments.