Adds CodeBook background segmentation method

This is an implementation of http://www.umiacs.umd.edu/~knkim/paper/Kim-RTI2005-FinalPublished.pdf. Took something from the legacy codebook code.