Add capability to export internals. Add tests. Correct get_countdown()

- use mocha and chi for testing
- get_countdown() use to rely on a variable in the parent scope