Fix bug where files could not be uploaded.

Turned out to be a naming convention mismatch. Also, inline javascript was moved to its own file.

#108