Learning of Actions and Goals through Observation and Imitation