Constructor and destructor, unit tests.