shared: Move private client library functions to their own file