Use AbstractCommand

Simplifies the registering of commands.