refactoring ndm to use scripts rather than bin

* refactoring ndm to use the scripts stanza rather than the bin stanza (I think this is clearer).
* adding the ability to run scripts in the context of the environment described in service.json.