This AND uses divide-and-conquer to recursively keep splitting the bits in a word into smaller groups. If any of the groups is all zeroes, it returns quickly. Once the parameters are 4 bits or less, it will use a lookup table which it builds on the fly to reuse a previous result. (This is called 'memoization') A less optimised but much prettier implementation of both AND and OR can be seen at http://scratch.mit.edu/projects/29513876/
Inspired by dcpu-16's code to implement efficient 8-bit bitwise operations. This doesn't improve on that for speed, but does handle 32-bit ints. Or change the mask from 65536 to 4294967296 to handle numbers larger than 32 bits. [Currently may be buggy if inputs are 4294967296 and 4294967295]