Implement prefered quality and encoding #5
Add tests and travis support