Moved quit() messages to messages.js and fixed GH-818.