Isolates plugins in anonymous functions
Add position and link for media.
Refactoring.