Still a lot of implementation details to clean up for all three metrics, but I think this is decent conceptually. Might be able to get down to pseudo-period 3 without much additional cost.