Improve intuitiveness and error diagnostics of internal type loading logic.

* Change (internal) function "fetchTypes" so that resulting type(s) is/are *applied* to the callback function. This way, when in a single type is fetched, the callback can access the result as a single named argument, which is much more intuitive than indexing into an array.
* In "typesFromJson", if the result for a given type is null, then that means it is an invalid type. In this case simply pass null to the callback (if one is specified).
* If an error occurs when fetching path types due to an invalid type/path, then ensure that the path is reconstructed for error diagnostics purposes.
* When falling back to processing a path as a static path, if a null is returned from "fetchTypes", then raise the original error in order to highlight the path that is in error.