Clean up debug messages and add comments.

Document edge case which can cause user to never be asked for
publish_actions again.

Remove console.log() messages from Javascript response.

References Coursemology/coursemology.org#179.