Refactor sequence module to accept new history data structure.

/cc @rich-nguyen