Run "before" methods for commands and tasks