Added tests for PUT request. Added Host check for HTTP/1.1. Did some refactoring