refactors, docs, tests

More of everything plus some refactors in the providers.