Convert the functions into a generic private lib

Sponsored-by: EMC / Isilon Storage Division