Change numerous global functions for anonymous ones

Change-Id: I0ba056cce8e1ec53468105d551e4509c66c4b518