Use correct media db overlay for extended entry properties.

References #110
Use correct media db overlay for theme options.

References #110
Re-use choose_media for selecting category icons.

Also, save some JS performance by generating the button in Smarty,
not in JS.

References #110 #85