Curriculum Design for Teaching via Demonstrations: Theory and Applications