lots of rearrangements, use googletest for tests, cmake for builds