Refactoring

The included patches dramatically improve stability on my system when using the fbt provider and so far, I have found no regressions. Testing is primarily done using fbt to analyze ZFSOnLinux. I am opening this pull request for feedback.