Fix for incorrect exception handling on request reading error in HA.

 o Added test and implementation for better error handling on early request parsing failure.
 o Moved serialization of requests and deserialization of responses into Protocol class.
 o Added handling of BranchedDataException in HAMS.