Fix issues with problem detector when used at runtime.

We weren't tracking library & dependedOn state properly for the
singleton wrapper. We also require a more strict format for
requiredBy: it must be the provider method name.

Also number the errors from 1. We number the cycles from 0 because
the last element in that list is equal to the first element.