Added support for uploading directories (from webkit browsers) and improved upload in general