Add stack trace for unexpected errors
Log stack trace in JSON format for unexpected errors
Fix log for CA errors. Protect casPath too
Fix Issue #142. Add warning if CAs dir is not set. Do not try to use null or undefined