Incremental commit: integrated new lib into UnitTests and fixes some global var code