Implement command line remapping commands.

Fixes #557.