Implement --js_dir

Re-staging this change.

Fixes #439