Added infrastructure for unit tests and some unit tests