Fix media changing bug

Need to destroy and recreate the tree when we change the whole media.
Remove a dependency to jquery ui in the html.
Charge the media in the local storage on startup.