Changing visibility of private attributes to protected

It's currently impossible to cleanly override classes in this library, due to the private visibility of most attributes. With this change, overriding would be much easier.