A generative model for vision that trains with high data-efficiency and breaks text-based CAPTCHAs