Conversion factors

This is a duplicate of #212, but rebased to get rid of the extra commits.