Register commands and initialize class instances.