Start to add unit tests and logging facilities for https://rdotnet.codeplex.com/workitem/140