Label3d

This pull request features two things:

1. 2D labelling refactoring. This has resulted in:
   * Higher readability of the code by breaking large functions into smaller ones.
   * More exhaustive documentation of the code.
   * Better performance.

2. Addition of support for 3D arrays.

I have read the papers that were referenced in the code. I think have understood them to let's say 90%, but I have found the implementation of the 2D labelling slightly different than the algorithm described in the paper by Kensheng et al. (there is no decision tree and also only one iteration is performed).
I have therefore implemented the 3D in an analogous manner. Since it has passed my (simple) test cases, I think that it is time to come up with it and get some feedback from you guys.
I understand that concern. However:

1. Introducing a set of (4, 8) and (6, 18, 26) values of parameters is not good when a 2D array is treated as "flat" 3D. Then 4 would have to become 6, 8 -> 26 etc. Moreover, the 3D labelling uses the 2D labelling functionality, so translation of neighbours would have to happen both ways. A dimension-agnostic parameter is much better.
2. I have googled "scipy connectivity" and haven't found anything that would fit. Could you be more specific? It sounds good to me, I understand it as translating 4- and 6-connectivity to 1, 8- and 18-conn. to 2 and 27-conn. to 3. Is that right?
3. Discriminating between "edges touch" and "only vertices touch" is easy to implement.