Added analysis module. Refactored the trace module.