Cleaned up uploaded file handling. Much nicer now. refs #391