make plugin_dir accessible from within JS. Fixes #185