Add trivial implementations of ~, &, |, and ^.

Each non-destructive binary operation returns an object with type
same as the left-hand-side operand.