switch to autotools, vendorized gtest and fix tests