More robust graceful shutdown
Centralize paths derived from __dirname in paths.js
Got tests working.

Removed default values for timeouts and throw errors properly.