refactored different distance metric support
added cat_train_dists.m which uses Corke's Machine Vision Toolkit (http://petercorke.com/Toolbox_software.html)