general: Replace pass by reference with pass by value

It was a nice attempt to try to do this good from the start.
Unfortunately the service locator is really difficult to do with
references, so this has to go.