merging stuff from torch7-distro

jonathantompson: Fixed PairwiseDistance for odd Lp norms; Fixed the bprop in PairwiseDistance for pnorms other than one. The gradInput has always been wrong it seems; the sign of the gradient is correct but the magnitude was wrong. I also added a test in extra/nn/test/test.lua for nn.PairwiseDifference, which tests both the batch and non-batch code paths for a few different p-norms.; it seems like torch.abs() doesn't have a cuda implementation, so the previous commit would fail when PairwiseDistance():cuda() was called.; fixed a bug in Pairwise distance when the output Lp norm is zero (which results in a divide by zero issue). Rewrote PairwiseDistance following Clement's suggestion to only have one codepath. Fixed a small bug in extra/test/test.lua where the input to the non-batch fprop test was zero.; going back on Clement's suggestion. It was a good idea, but we're needlessly loosing performance in the 1D case with the input clone.; Fixed a bug in PairwiseDistance where the gradInput table isn't converted when Module.type function is called (this bug has always existed and is not due to the recent changes).; fixed PairwiseDistance type() function bug. Overloaded type now returns self.