Moved first batch of analysis tool source to C++