Fix doctests
Update arraypad tests
Add support for 3-D template matching