This PR is already pretty massive. I suggest removing the camera swap stuff and doing that in a separate PR, since I think that will require a more detailed review.