Implement bit functions.

Signed-off-by: Konctantin <gawrilyako@gmail.com>