More bug fixes to find_pupil_edge, tested on several sample cases and appears to match the offline implementation perfectly now.