lib/client: moving extend to utils.js