Media library item refactoring and tests.