Move remaining global functions into 'namespaced' places.

Static functions on prefixed classes are less likely to cause issues
with userland applications than simple global functions.
Updat pages to use new methods.
Fix failing test.