Changed array and matrix to element-wise. Added xor.

#86 #250