Fixed ClassCastException when commands with custom encoders fail.
Steps to a clearer separation between encoding and decoding Commands
Simplified encoding and decoding of Commands with payloads (i.e. find and modify).