Added gtest and several unit tests