Flexible message handling at remote protocol layer

Merge from njx/brackets-livedev2#6