Googletest tests

Most unit tests ported to googletest framework as described in #728 - see that issue for a full list of changes and detailed description of the new testing framework. Testing in Ubuntu/CMake is happening now.