SQL message bus changes to allow unit testing

Made some changes to allow unit testing SQL message bus pieces and added a few unit tests to start.