Reuse 2D sum in 3D sum
Add tests for 3-D template matching