Added classes TimingAnalyzer and MemoryAnalyzer and cleaned the code.