refactored RAW_SET (was APPLY_MASK_TO_WRITE) macro

* supporting now endianness convertion
implemented writing access to buffers

* separated bit operations in a new module (bit_util)