More testing and bugfixes added.

Changing to use a UnitsError exception (which is right now just
an alias for ValueError, but should be made into its own class
later).