Add capabilities checking and the READ capability

Summary: - also change `raise StopIteration` back to `yield ''` since that was a bug

Reviewers: usmanm, marcua

Reviewed By: usmanm

Differential Revision: http://phabricator.locu.com/D2932