c++ porting of the TextSecure core classes