Store media in a generic Media model

As the project has developed, it has become a generic framework
for encoding and uploading media. The distinction between Audio
and Video was no longer used internally, and became increasingly
meaningless, as you can now do things like encode the audio and
extract still images from a video file.
Refactor upload_to callable for media