Added HTTP envelope

This is an attempt to address #370 and #429.