Refactored media loading a bit and added sample map loading.