Moves range intersection calculator to the lib directory