first cut at sampling phasings

@mjhubisz

This is a PR for the phasing integration feature.  I `cherry-pick`ed this commit from your previous work.  I can review now this or hold off until later.  Whatever works best for you.  This looks very cool.