Fix commands, the easy way.

I don't know why I haven't thought of it earlier.
This doesn't require a complete refactor, nor changes to pluginhook, as opposed to #312.

I believe the refactor would still be useful and make it cleaner. At least we have an intermediate solution, which we could pull into v0.2, if you agree.

fixes #343 #319 #272 #236