Let Dependency.toString() also contain the optional/path properties.

versionString is changed into a public property to support the use cases where only the version range is expected.