Extracted providers into own classes

Various other fixes. Testing now.