Scan plugins when building index

This'll be useful later when we actually can use the plugins....

Also improve error reporting a tiny bit.

Change-Id: I51fbc494bb203b385326de5568af85b934ad92f8
Merge "Scan plugins when building index"