Updated main.js to the new client module format