Significant refactoring. Added repo pull feature with smart change detection.