Some code cleanup and more unit tests, making Sonar happy
More cleanup
Merge pull request #96 from futures/CodeCleanup

Code cleanup