Refactor analyze.cpp into multiple files. Refactor time-dependent rates implementation, de-duplicate code.