Adds a long integer bits4subtree_ids to each node (Fails cryptically if that field is already present!)
        relevant_ids can be a dict of _id to bit representation.
        If it is not supplied, a dict will be created by registering the leaf._id into a dict (and returning the dict)
        the bits4subtree_ids will have a 1 bit if the _id is at or descended from this node and 0 if it is not
            in this subtree.
        Returns the dict of ids -> longs
        Also creates a dict of long -> node mappings for all internal nodes. Stores this in self as bits2internal_node

def add_bits4subtree_ids(self, relevant_ids):
        """Adds a long integer bits4subtree_ids to each node (Fails cryptically if that field is already present!)
        relevant_ids can be a dict of _id to bit representation.
        If it is not supplied, a dict will be created by registering the leaf._id into a dict (and returning the dict)
        the bits4subtree_ids will have a 1 bit if the _id is at or descended from this node and 0 if it is not
            in this subtree.
        Returns the dict of ids -> longs
        Also creates a dict of long -> node mappings for all internal nodes. Stores this in self as bits2internal_node
        """
        if relevant_ids:
            checking = True
        else:
            checking = False
            relevant_ids = {}
            bit = 1
        self.bits2internal_node = {}
        for node in self.postorder_node_iter():
            p = node._parent
            if p is None:
                if not node.is_leaf:
                    self.bits2internal_node[node.bits4subtree_ids] = node
                continue
            if not hasattr(p, 'bits4subtree_ids'):
                p.bits4subtree_ids = 0
            i = node._id
            # _LOG.debug('node._id ={}'.format(i))
            # _LOG.debug('Before par mrca... = {}'.format(p.bits4subtree_ids))
            if checking:
                b = relevant_ids.get(i)
                if b:
                    if node.is_leaf:
                        node.bits4subtree_ids = b
                    else:
                        node.bits4subtree_ids |= b
            else:
                if node.is_leaf:
                    relevant_ids[i] = bit
                    node.bits4subtree_ids = bit
                    bit <<= 1
            if not node.is_leaf:
                self.bits2internal_node[node.bits4subtree_ids] = node
            # _LOG.debug('while add bitrep... self.bits2internal_node = {}'.format(self.bits2internal_node))
            p.bits4subtree_ids |= node.bits4subtree_ids
        return relevant_ids