BUG-981: defensive checks

This patch rewrites getClassForPath() to be more defensive and helpful
in diagnosing problems.

Change-Id: I24cd31819f0aea7f67bf6bc2e6c65168b1f3cae5
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 2eafef38d797ac614a04236102d19d0c47011804)
Signed-off-by: Robert Varga <rovarga@cisco.com>
BUG-981: cleanup superfluous use of Callable

As it turns out, wrapping code in a callable is completely unnecessary.
Removing it makes the code much more clear and allows for proper
inspection.

Change-Id: Ib57c9996fc8faaa8388736d469334eb2952bf018
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 7c8f6866bb091b4184bc7f31d3836dfac24a65ef)
Signed-off-by: Robert Varga <rovarga@cisco.com>