Use astropy.units.Unit and strings.

This gets rid of Eclipse PyDev static code analysis error.
Consistently use numpy.testing.assert_allclose in unit tests.