Fix guessing of package name and version.

Hi,

We had a problem where some of our packages could not be installed via pip from our pypiserver instance. This occurred after upgrading from 0.5.0 to 1.1.2 and it is due to a change introduced in 0.5.2. I have created a patch for this which passes all existing tests and currently works well for us.

The fix in commit 7f97612 for supporting the package naming used by the pytz module caused a regression if the package name contained a dash followed by a number. We fix this by splitting on all dashes followed by numbers and recreating the package name from all components but the last.

Cheers,

Nick

CC: @wimpr1m