Added ldagibbs unit test.
Added unittests for core.
Unit tests and bug fix.
merge conflict.