Implemented sending both urlencoded and multipart form data and fixed a number of bugs.