Add JavaScript support

https://trello.com/c/LQsUqhYU/179-support-javascript
Do we really need the check of `legacy_config? == false` here?