Cleaned up the file submission section a bit.

Slightly annoyed at the code's layout of managing file uploads, I did a bit of cleaning to that part.
It works properly in my local environment as of now, but will keep an eye out for bugs. Let me know if it fucks up.
And it seems my gitignore adjustments got shoved into it as well.