NOBUG: attempted fix for list_valid_components.

This is not failing on my local jenkins, but on integration
and stronk7 it is reporting the wrong directory as the prefix for the
plugins (the local_ci dir - not the master branch dir).

Testing to see if setting dirroot before clearing the cache fixes this.
Revert "NOBUG: attempted fix for list_valid_components."

This reverts commit 992bfa85e0349d2028da95252007078969317ba5.

(Reverting this because it didn't fix anything).
Reset core_component caches before asking for components

Now local_ci requires Moodle 2.6dev (201307104) so the new
core_component stuff is available always.

No matter of that we continue using the old (deprecated in 2.6
and upwards) get_plugin_types|subsystems|...() calls. Some day we'll
move to the new methods available within core_component.

But the key change here is that, via inheritance, we add a reset() method
able to clean the static caches built in the class, so the nasty hack of
forcing dirroot will continue working and the components will be returned
properly.

Personally I'm not happy with this solution (double-hack), but it's the fastest
one I've been able to achieve. In the future we should, somehow install
the site properly, ask for the list of components and store it into some "work"
directory so other jobs can reuse it. But not today. :-(