embed_audio and link_externally functions refactor and add tests