Support simple bitwise instructions

Add support for generating "and", "or" and "xor" instructions. The "and"
instruction is needed for runtime type assertions and the code is easily
generalized to support "or" and "xor" at the same time.