Rotate preview layer on rotation change and use metadata to return properly rotated images.

We need these changes internally. It's definitely worth a double check they work for you before merging. I've seen all sorts of configuration options with AVFoundation work unexpectedly.