Created motion model and video writer. Fixed several minor bugs.