Improvement on sha512crypt and map device numbers.

How should I break this into small packages of commits?