Broke up controls.js into multiple files.

Cleaned up media.js files also.