Text this: Self-Supervised Foundation Model for Template Matching