First work on response handling
Added option to use an envelope for the response. This closes #4