Add log analyzer and tests
Minor Refactor