Move reference processing next to its implementation.

With this change, all of the reference processing now happens in the
same module.  As such, we can make all of the implementation routines
static.

Change-Id: If3f1ff2e48f49b57b75cfc9d0af61ad892435c47
3 files changed