This introduces a new juju-core/names pacakge, which contains all name and tag related functions shared between state and API: IsUnitName, UnitTag, UnitNameFromTag, MachineTag, MachineIdFromTag, IsServiceName, etc.
Because of the pacakge name, some functions were renamed: names.IsUnit, IsService, UnitFromTag, all refer to names.
In addition, a change was made to these two functions: UnitNameFromTag and MachineIdFromTag. Both of them now return (string, error), rather than just string. The error return is used in case the passed tag string has an invalid format. Because of this change, some places needed slight refactoring, otherwise no other changes where made.