Learning Compound Tasks without Task-specific Knowledge via Imitation and Self-supervised Learning