Added inline comments. Cleaned up cli.js.