Unit tests.

Add unit tests framework and tests.