Switch to using the mathutils.kdtree module for KDTree implementation.

This has support for multiple nearest neighbor searches.
Added a new group for templates (formerly "patches") and moved blob
generating code into the proper file.
Use the blob group to keep blob objects from polluting bpy.data.
Moved patch baking code into the patch module where it belongs.