Moved client functions from receiver.js to new client.js