Finished refactoring in preparation for Smuggler for file systems.