First draft of new subsets API.  Needs testing & debugging.