Introduced get_bits and set_bits macros

Should reduce the amount of errors encountered if new operations are added.
Added more encode macros