BUG-509: InstanceIdentifier should be Comparable

This patch does several things in one go:

It guards InstanceIdentifiers which are not permitted to have an empty
nodeType with a checkNotNull().

Based on that it optimizes NodeIdentifier.hashCode() and makes it
implement Comparable interface, which is trivial givven that QName
already implements it.

Change-Id: Ib249034fba875df7ad0455786b74c908d80893fb
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 9297762a6d1fd0a890902b18bcd970717e1e6338)