Rewrite command decorator to be class based.

This allows for some more methods and attributes needed for
the decorator later on.