Fix bug in array padding, template matching

This is a re-implementation of `match_template` in pure Python with only Numpy operations.

Performance decreases for me ~20%.

There are now also more padding options.

This also fixes: https://github.com/scikit-image/scikit-image/issues/845