Extend rate command, support direct rate/unrate.

See README.md for more details.