Added new and random commands and code to support them.