Refactor various parts of the codebase to use `RoomVersion` objects instead of room version identifier strings.