Implement self-upgrade