Tidied up media embedding code

Moved the code to embed YouTube and Spotify media into their own
functions.