Unable to check result "undefined" in cli

https://issues.jboss.org/browse/WFLY-4118
Ok, let's keep the path-exists check out of this but let's include the fix for not-equals comparison. Because these two assertions clearly look wrong. I'd remove the type check, i.e.

if(((ModelNode) left).getType() != ((ModelNode)right).getType())

from ComparisonOperation.resolveValue(ctx, response) and simply let it call compare(left, right). Also, I think, the signature of this method could change to compare(ModelNode left, ModelNode right).

Then NotEqualsOperation would extend ComparisonOperation and perform the type comparison as the first line in its compare(left, right).

Then a new abstract class SameTypeComparisonOperation would extend ComparisonOperation and its compare(left, right) impl it'd compare the types first. If not equal, return false. Otherwise, call an abstract boolean doCompare(left, right). Then all the other operation implementations would extend SameTypeComparisonOperation and implement doCompare(left, right) like they do now.

What do you think?