Added test uploading functionality

Cleaned up web handling code.