Added test infrastructure.
Added tests.