Added CSV import, fixed #1186. Also cleaned up motion CSV import.