Fix regression in f4429ad
Refactor command and bang logic into new CCommandHandler class
This also improves bang log messages, which now include the bang name.