Update rest-comms.js

Cleanup, unused code removed, future code marked