vectorize boundaries()

Hi, 

Currently boundaries() function only accepts one pixel id. In this patch I vectorised the function by allowing array arguments. 

Cheers,
        Sergey 

The code seems to work for me. The only thing is the doctest, I'm not entirely sure that it is correct, because nosetests --with-doctest -v didn't  seem to run the appropriate test