Add 3D texture connectivity and code cleanup

Added Ascii comment headers and cleaned up multiline comments.
Chaned XY to XZ to better explain which directions are checked.
Added XYZ checking.
Added general functions to easily add new connective blocks later.