Updating event system to be able to emit errors

I've updated the event system to be able to emit events when an exception is encountered while  preparing commands, transferring requests, and processing commands. This
change makes the Command layer behave in a similar manner to the HTTP layer.

When an Exception is encountered while preparing a command, the error
event is emitted for the Command, allowing listeners to handle the problem
before an exception is thrown. This type of evented error handling is required
in order to be able to send commands in parallel or in batches.