Long Lived Codebases: Architecture Gardening, Rewrites, and Automated Tests