Cache preloaded tasks

Since task preloading is often used as a config sharing mechanism, it is
not uncommon for many tasks to preload the same task. Additionally many
tasks preload tasks which also preload other shared tasks, in our
current production site, there are as many as 5 levels of preloading.
Cache all preloaded tasks to avoid having to reload each level if the
level has already been preloaded by another task (which is very common).

Change-Id: I1ecc7d139141fdaadcb7f9d25ee61757314de382
4 files changed