added a unit conversion function that seems to be well behaved.  also fixed an import error in unit_library