Allows different implementations for different platforms (the JS build relies on browser APIs to stream disk images over the network). Setting aside the JS build, this also reduces some code duplication.