Added several functions for request handling, fixed PING responses, added QUIT request.
Grammar changes for wider request handling.