Listener bugfix and new tests

Created a destructor for Listener that properly removes the Listener's
thread from the NContext's thread_group upon desctruction.

Converted ListenerTest.cpp into an actual unit test