SourceReader: Bugfix false-negative if exceptions are thrown in socket reader initialization

This patch implements a fix to the false-ngative bug tracked by https://github.com/walmartlabs/mupd8/issues/35.

The bug comes from the fact that the socket-type reader may be initialized to "None" if the source hasn't bound yet.  So subsequent reads would always produce false-negative because the reconnection bit never gets executed.

This patch also introduces automated tests for the lazy binding source:
- SourceReader shouhld connect to a socket during initialization, retry until success.
- SourceReader should reconect to the socket if there was any exception during reads.

Note that some necessary code refactor is made to enable the stub/mock testing, which arguably entails better coding style.

Isseue: https://github.com/walmartlabs/mupd8/issues/35
Testing:
Manual.
Automation passed on new test cases and no regression.
Mupd8Main: Wrap consturctor of SourceReader in breakable

Because the SourceReader's constructor now will try to connect to the socket until success, the caller should wrap it in a breakable block.
SourceReader: Add logging to reconnection attempts
SourceReader: bad initialization do not crash main thread

This patch adds to the main thread the uncaught exception handlers for all source threads, such that exceptions during file source initialization do not crash the main thread.
For file source, any exception during initialization will stop the source thread and propagate to the main thread, but will be handled gracefully by the callback handler at main thread, which simply loggs the error.  The reason behind this design is that (1) callback handler is a good way to turn the main thread into daemon-like process; (2) we only need to handle the errors that the SourceReader is supposed to handle based on its semantics, e.g. socket source should be reconnectable so the semantics require SourceReader to siliently reconnect when initialization or reading fails; whereas for file source, we do not allow reconnection, so simply propagating the error to main thread and let the main thread deal with it is fine with me.
Merge pull request #38 from zheguang/sam-fix-sourcereader-issue35

Issue35: Bugfix SourceReader initialization for sockets
1. Wait for current performerpacket done before flushing slates into database; 2. when ring changes, put events need to be transferred into another queue and when ring change is done put those events into local queue; 3. spin off couple classes into seperate files; 4. fixed couple small bugs
merge source reader fix from master