specify precisely the type of the 'eventListeners' member
properly handle session termination

A case was missed when the session is stopped determinsticially, but was
relying on the next underlying event to be emitted to handle setting the
session to `null'`.  Another asynchronous event could also happen in
between where '.stop()' was called, but the Session wasn't marked as
terminated already.

This change uses a cached Promise to resolve whether underlying session
is proplery stopped and having the wrappers internal state set
appropriately.
improve blpapi-wrapper logging with log levels

Refactored logging to properly distinguish between debug and trace level
logging.
use TypeScript anonymous functions and minor cleanup

During the converstion to TypeScript, there was a missed '() => {}'
style anonymous function.  Also a resolved // TODO comment was removed
due to being resolved.
refactor operations into private methods

This change is in preparation for supporting subscriptions.  The
generation of the next correlator id has been refactored into a
independent method as well as the code required to open a service.
echo an extra newline in example/ex1.sh

At the end of the example, the extra newlines ensure that your command
prompt displays properly.