Finally some success with grain reconstructions. Fixed bug in boundary
detection. I was using two different methods (one for 2D exemplars) and
one for 3D reconstruction that I thought were equivalent but were not.
I changed them both the the circshift method in matlab and that made
the reconstructions start to converge.

In addition, I added support for getting the unique grain id lists
when neighborhoods are extracted. This is fast now as I used STL
sets in C++. Now that I have something working I will optimize a bit
further.