Electrocardiogram Report Generation and Question Answering via Retrieval-Augmented Self-Supervised Modeling