Providers update

I've cleaned up the implementation of type provider elaboration to give better, more specific errors and to be more readable and maintainable.

No new features.