Improve spell length calculation to allow for spells crossing period boundaries
Using the new post-processing infrastructure, we should be able to implement spell length calculations that treat spells crossing period boundaries the same way as the reference implementation does.