refactor directions API

- accept params and callback rather than tens of parameters
- add parameter combination logic to prevent invalid API use
- add a valid public browser key to tests