mei: move client functions to client.c