Add revert_to_published method.

STUD-1860

OK, @dmitchell has patiently helped me through writing this method. Please review, @dmitchell and @nasthagiri.
Yes, this is in the modulestore which does the db manipulations. It should do native db operations wherever it makes sense imo. It should not convert things to xblocks if it doesn't need to send them to callers.