Clean up

Cleaned up source and added some comments.
Added .avi detection.
Made readme more clear.