LMNN implementation and a couple of unit tests