Change a bunch of reference function arguments to pointers.

Per the coding style and sanity.