Cleanup of media backend code

Some much needed maintenance to the media player backend code, putting it in the correct namespace, folder structure and making the code testable