MalformedMessage extends Runtime and added Protocol

Make MalformedMessageException extend Exception and not
RuntimeException. Also implement the new response codes of the
protocol.