nopt configuration via json file

- change --debug to alias of --loglevel debug
- add -d/--directory
- tests
minor, @doc comments